package com.base.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.base.utils.Page;
import org.apache.ibatis.annotations.Param;
import com.base.po.sqlparam.PayinfoesExamplePage;
import com.base.po.voip.Payinfoes;
import com.base.po.voip.PayinfoesExample;

public interface PayinfoesService {
    int countByExample(PayinfoesExample example);

    int deleteByExample(PayinfoesExample example);

    int deleteByPrimaryKey(String id);

    int insert(String mobile, String cardno, String pwd, String parentid, Boolean status, Integer money,
               Boolean datastatus, Integer type, String alistatus, String ordernum, String alimoney, Integer cardtype);

    int insertSelective(Payinfoes record);

    List<Payinfoes> selectByExample(PayinfoesExample example);

    List<Payinfoes> selectByExamplePage(PayinfoesExamplePage example);

    List<Payinfoes> selectByUser(@Param("parentid") String parentid, @Param("mobile") String mobile);

    List<Payinfoes> selectByPerformance(@Param("page") Page page, @Param("userid") String userid,
                                        @Param("priopentime1") Date priopentime1, @Param("priopentime2") Date priopentime2);

    List<Payinfoes> selectByMuskUserId(@Param("parentid") String parentid);

    List<Payinfoes> selectByUserId(@Param("userid") String userid);

    Payinfoes selectByPrimaryKey(String id);

    Payinfoes selectByOrderNum(String ordernum);

    Payinfoes selectByShopCountMoney(String shopId);

    int updateByExampleSelective(@Param("record") Payinfoes record, @Param("example") PayinfoesExample example);

    int updateByExample(@Param("record") Payinfoes record, @Param("example") PayinfoesExample example);

    int updateByPrimaryKeySelective(Payinfoes record);

    int updateByPrimaryKey(Payinfoes record);

    int payinfoesByCount(Payinfoes record);

    int countByPerformance(@Param("userid") String userid, @Param("priopentime1") Date priopentime1, @Param("priopentime2") Date priopentime2);

    BigDecimal selectAllMoney(@Param("parentid") String parentid, @Param("begin") Date begin, @Param("end") Date end);

    Payinfoes sumByMobile(String mobile);

    Payinfoes sumByMobileAndParentid(@Param("mobile") String mobile, @Param("parentid") String parentid);

    Payinfoes sumByMobileAndShopid(@Param("mobile") String mobile, @Param("parentid") String parentid);

    BigDecimal selectByMoney(@Param("parentid") String parentid, @Param("mobile") String mobile);

    BigDecimal selectAllPerformance(@Param("userid") String userid, @Param("level") Integer level);

    BigDecimal selectPerformance(@Param("userid") String userid, @Param("priopentime1") Date priopentime1, @Param("priopentime2") Date priopentime2);

    BigDecimal selectLv1Performance(@Param("userid") String userid, @Param("priopentime1") Date priopentime1, @Param("priopentime2") Date priopentime2);

    BigDecimal selectLv1And2Performance(@Param("userid") String userid, @Param("priopentime1") Date priopentime1, @Param("priopentime2") Date priopentime2);

    BigDecimal selectPerformanceTabId(@Param("tabid") String tabid, @Param("priopentime1") Date priopentime1, @Param("priopentime2") Date priopentime2);

    /**
     * 今日充值
     *
     * @param parentid 代理商ID
     * @param today    今天
     * @return
     */
    int countDay(String parentid, Date begin, Date end);

    /**
     * @Date: 2019/9/30 9:26
     * @Description:
     *
     * 根据充值类型进行判断
     */
    Integer countAllBytype(String parentId, String time1, String time2, int type, Page page,String mobile);

    List<Payinfoes> selectAllBytype(String parentId, String time1, String time2, int type, Page page,String mobile);
}
